Type Resolution

Type and overload resolution is performed by means of the well-known two-pass algorithm. During the first (bottom-up) pass, each node in a complete context is labelled with its type, or if overloaded with the set of possible meanings of each overloaded reference. During the second pass, the type imposed by the context is used to resolve ambiguities and chose a unique meaning for each overloaded identifier in the expression. When resolving a call to a primitive operation of a tagged type, the second pass also determines the actual in the call that is to serve as controlling argument of the dispatching call.